#pragma once
namespace cvLib
{
	class TrackingObjects{
	public:
		CvRect selection;
		CvRect trackWindow;
		CvBox2D trackBox;
		CvConnectedComp trackComp;
		IplImage *image;
		IplImage *hsv;
		IplImage *hue;
		IplImage *mask;
		IplImage *backproject;
		bool isTrackingInitialized;
		CvHistogram *hist;
		int smin;
		int vmin;
		int vmax;
		double direction;
		double x,y;

		TrackingObjects(){
			x = 0;
			y = 0;
			direction = 0.0;
			smin = 30;
			vmin = 10;
			vmax = 256;
			selection = cvRect(0,0,0,0);
			image = 0;
			isTrackingInitialized = false;
		}
		~TrackingObjects(){}

		void setupImages(int width, int height);
		void copyImage(IplImage *srcImg);
		void initilizeTracking();
		void startTrackObject(struct camera_parameters cp,struct calibration_constants cc);
		void setTrackWindow(CvRect tmpRect);
		void convertToHSV();
		IplImage* getTrackedFrame();
		CvRect getTrackWindow();
		void drawRectangle(CvRect objectLocation);
		void drawDirection();
	};
	
}